import Vue from "vue"
import VueRouter from "vue-router"

Vue.use(VueRouter)
const routes = [
    {
        path: "/",
        // name: "Main",
        component: () => import("../views/Main"),// 组件懒加载
        children: [
            {
                path: "/",
                name: "home",
                component: () => import("../views/home"),
            },
            {
                path: "/lib/:id",
                name: "lib",
                component: () => import("../views/lib"),
            },
            {
                path: "/statistic",
                name: "statistic",
                component: () => import("../views/statistic"),
            },
        ]
    },
    // {
    //     path: "/login",
    //     name: "login",
    //     component: () => import("../views/login/login.vue")
    // }
]

const router = new VueRouter({
    mode: "history",
    routes
})

export default router